﻿using AnesSystem.Models;
using AnesSystem.Services;
using AnesSystem.Util;
using Models;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;

namespace AnesSystem.ViewModels.WorkScore
{
    class WorkScoreDetailsCtrlViewMode : BaseViewModel<WorkScoreDetailsCtrlViewMode>
    {
        #region Variables
        private int _startAge;

        private int _endAge = 100;

        private DateTime _startDate = DateTime.Now;

        private DateTime _endDate = DateTime.Now;


        #endregion

        #region Constructor

        public WorkScoreDetailsCtrlViewMode()
        {
            Seach();
           
        }
        #endregion

        #region Properties

        public int StartAge
        {
            get
            {
                return _startAge;
            }

            set
            {
                _startAge = value;
            }
        }

        public int EndAge
        {
            get
            {
                return _endAge;
            }

            set
            {
                _endAge = value;
            }
        }

        public DateTime StartDate
        {
            get
            {
                return _startDate;
            }

            set
            {
                _startDate = value;
            }
        }

        public DateTime EndDate
        {
            get
            {
                return _endDate;
            }

            set
            {
                _endDate = value;
            }
        }
        #endregion

        #region 依赖属性

        #endregion

        #region Event

        #endregion

        #region Private Methods

        public GongFenZhiBiaoRCModel Seach()
        {
            //GongFenZhiBiaoRCModel gongFenZhiBiaoRCModel = PatientLinkService.Instance.id(DataManager.Instance.CurrentPatientLink.Id);
            //patientLink.Gongfen = gongFenZhiBiaoRCModel;
            //if (DataManager.Instance.CurrentPatientLink != null)
            //{
            //    PatientLinkModel patientLink = DataManager.Instance.CurrentPatientLink;
            //    PatientLinkService.Instance.Update(patientLink);
            //}
            Calculation();
            return null;
        }

        public GongFenZhiBiaoRCModel Calculation()
        {
            PatientLinkModel patientLink = DataManager.Instance.CurrentPatientLink;
            WorkScoreUtil.CalculateScoreDetails(patientLink);
            //PatientLinkService.Instance.Update(patientLink);
            return patientLink.Gongfen;
        }


        #endregion

        #region Public/Protected Methods

        #endregion
    }

}
